Skip to content

Render embed chooser current-target tile as a fitted card#5516

Open
FadhlanR wants to merge 2 commits into
mainfrom
cs-12110-embed-chooser-current-target-tile-shows-only-name-never-the
Open

Render embed chooser current-target tile as a fitted card#5516
FadhlanR wants to merge 2 commits into
mainfrom
cs-12110-embed-chooser-current-target-tile-shows-only-name-never-the

Conversation

@FadhlanR

@FadhlanR FadhlanR commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

In the markdown embed chooser's edit mode, the current-target tile (above the Replace / Remove buttons) showed only a text label — the filename for files, the card title for cards. Per the design, it should render the placed card/file itself in its fitted template — a compact "Double Strip" chip (thumbnail + title).

This replaces the text label with the resolved target rendered fitted, reusing the existing MarkdownEmbedPreview component. Both cards and files render through the same fitted path, and a broken/unresolvable preload shows the compact broken-link visual in the tile. The tile's fitted size is fixed (it's an identity chip); the format dropdown on the right still drives the larger preview pane independently.

Resolves CS-12110. The ticket originally proposed showing the name plus a relativized URL; the design instead calls for the fitted card render, which is what this implements.

Changes

  • packages/host/app/components/markdown-embed-chooser/tab-panel.gts — drop the currentTargetLabel / toDisplayUrl text-label getters (and the now-unused maybeRelativeReference import); render MarkdownEmbedPreview at a fixed fitted 250×65 with the tile's existing broken-ref args.
  • packages/host/tests/integration/components/markdown-embed-chooser-modal-test.gts — the broken-ref test now asserts the compact broken visual in the tile; new tests cover a resolved card and a resolved file each rendering fitted.

Testing

  • markdown-embed-chooser-modal (14), codemirror embed toolbar (8), and the markdown embed chooser acceptance suite (4) all pass headless against the realm stack.
  • lint:types, eslint, and template-lint are clean.

Before

Screenshot 2026-07-16 at 21 16 45

After

Screenshot 2026-07-16 at 19 58 08

The markdown embed chooser's edit-mode current-target tile showed only a
text label (filename for files, title for cards). Render the placed
card/file itself in its fitted template instead — a compact Double Strip
chip — reusing the existing MarkdownEmbedPreview so both cards and files
render fitted and a broken preload shows the compact broken-link visual.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Preview deployments

Host Test Results

    1 files  ±0      1 suites  ±0   3h 5m 19s ⏱️ - 2m 42s
3 536 tests ±0  3 521 ✅ ±0  15 💤 ±0  0 ❌ ±0 
3 555 runs  ±0  3 540 ✅ ±0  15 💤 ±0  0 ❌ ±0 

Results for commit 069be4e. ± Comparison against earlier commit 8b16d3e.

Realm Server Test Results

    1 files  ±0      1 suites  ±0   17m 17s ⏱️ -18s
1 848 tests +3  1 848 ✅ +3  0 💤 ±0  0 ❌ ±0 
1 927 runs  +3  1 927 ✅ +3  0 💤 ±0  0 ❌ ±0 

Results for commit 069be4e. ± Comparison against earlier commit 8b16d3e.

@FadhlanR
FadhlanR marked this pull request as ready for review July 16, 2026 14:17
The current-target label this comment described was replaced by the
fitted chip render; the arg now only feeds the pane's directive
serialization.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@FadhlanR
FadhlanR requested a review from a team July 17, 2026 06:02
@habdelra
habdelra requested a review from Copilot July 17, 2026 13:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the markdown embed chooser’s edit-mode “current target” tile so it renders the placed card/file itself as a compact fitted chip (instead of a plain text label), aligning the tile behavior with the existing embed preview rendering path.

Changes:

  • Replaces the current-target text label with a fixed-size (250×65) fitted MarkdownEmbedPreview render, including broken-ref rendering.
  • Removes now-unused label/URL-relativization helpers and related import.
  • Updates integration tests to assert the fitted chip rendering for resolved card + resolved file, and to assert the compact broken-link visual for broken preloads.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
packages/host/app/components/markdown-embed-chooser/tab-panel.gts Renders the edit-mode current-target tile via MarkdownEmbedPreview in a fixed fitted footprint; removes obsolete label/relativization code; adjusts styling for the new preview element.
packages/host/tests/integration/components/markdown-embed-chooser-modal-test.gts Updates broken-preload assertions for the tile and adds coverage for resolved card/file current-target chips rendering in fitted format.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +130 to 136
// The current-target tile renders the placed card/file as a compact fitted
// chip — a fixed Double Strip (250×65), independent of the format the user
// picks for the actual embed in the preview pane. It's an identity marker for
// "what's placed here now", not the embed being configured.
private get currentTileSize(): BfmSizeSpec {
return { format: 'fitted', width: 250, height: 65 };
}
Comment on lines +254 to +258
<MarkdownEmbedPreview
class='markdown-embed-chooser-tab-panel__current-preview'
@target={{this.selectedTarget}}
@format='fitted'
@sizeSpec={{this.currentTileSize}}
Comment on lines +405 to 409
/* The fitted chip carries its own fixed footprint; keep it from
stretching to the centered column's cross axis. */
.markdown-embed-chooser-tab-panel__current-preview {
flex: 0 0 auto;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants